package main

import (
	"context"
	"github.com/zeromicro/go-zero/core/conf"
	"github.com/zeromicro/go-zero/zrpc"
	"log"
	"study-go-zero-client/greet"
)

func main() {
	var clientConf zrpc.RpcClientConf
	conf.MustLoad("etc/greet-client.yaml", &clientConf)
	conn := zrpc.MustNewClient(clientConf)
	client := greet.NewGreetClient(conn.Conn())
	resp, err := client.Ping(context.Background(), &greet.Request{})
	if err != nil {
		log.Fatal(err)
		return
	}

	log.Println("收到服务端响应:", resp)

}
